//
//  NSObject+JsonToModel.h
//  ruying
//
//  Created by yqh on 2019/2/23.
//  Copyright © 2019年 林伟钦. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSObject (JsonToModel)

+ (id)objFromJSON:(id)json;
+ (instancetype)modelFromDic:(NSDictionary<NSString *, id> *)dic;
+ (NSArray<id> *)modelsFromArr:(NSArray<NSDictionary *> *)arr;

+ (void)updateModel:(id)obj withDic:(NSDictionary<NSString *, id> *)dic;

- (NSMutableDictionary *)createDictionayFromModelProperties;


/**
 *  是否是合法的json格式
 */
- (BOOL)isValidJSON;
+ (BOOL)isValidJSON:(id)obj;

/**
 *  检查数据类型，返回字符串
 */
+ (NSString *)checkObj:(NSObject *)obj;

@end
